home *** CD-ROM | disk | FTP | other *** search
/ Best of Shareware / Best of PC Windows Shareware 1.0 - Wayzata Technology (7111) (1993).iso / mac / ZIPPED / DOS / PROGRAMG / QBTINY12.ZIP / PDQINFO.TXT < prev    next >
Text File  |  1992-11-19  |  16KB  |  386 lines

  1.     PDQINFO.TXT  Copyright (c) 1992  Crescent Software, Inc.
  2.  
  3. This file contains the text from a pamphlet on P.D.Q. 3.0.  A
  4. new version of P.D.Q. with additional features will be released
  5. shortly.  P.D.Q. is currently $149.  For technical information,
  6. call (203) 438-5300.  To order, call 1-800-35-BASIC.
  7.  
  8.    Crescent Software
  9.    11 Bailey Avenue
  10.    Ridgefield, CT 06877
  11.  
  12.  
  13.  
  14.          Introducing P.D.Q.: What C Was Supposed To Be
  15.  
  16.         A Revolutionary Concept in High-Level Languages
  17.                        (and Assembler too!)
  18.  
  19.  
  20.  
  21. No one would dispute the value of a program that's small and
  22. fast.  Indeed, compiler vendors such as Microsoft and Borland
  23. are constantly refining their products, to improve the
  24. performance and size of your programs.  Unfortunately, no
  25. high-level language comes even close to creating programs as
  26. efficient as those written in assembly language.  That is,
  27. until now.
  28.  
  29.  
  30.  
  31.                 Introducing P.D.Q. Version 3.0
  32.  
  33.  
  34.  
  35. This remarkable library lets you write programs that are
  36. extremely fast and compact, using a high-level language you
  37. already know.  Unlike C, Pascal, or QuickBASIC, P.D.Q. can
  38. produce a "Hello world" program with a stand-alone .EXE file
  39. size of only 750 bytes.  Real programs that perform useful
  40. tasks may be written in less than 2,000 bytes.  For example,
  41. P.D.Q. includes as an example a perpetual on-screen TSR clock
  42. program with an .EXE file size of less than 1500 bytes.
  43.  
  44. Also included are numerous examples such as a 1480-byte
  45. redirectable DOS "filter" program, and a utility similar to
  46. Peter Norton's 9K FILESIZE.COM, but less than 5K in size.
  47. Programs produced by P.D.Q. are often half the size of an
  48. equivalent written in C.  P.D.Q. truly is the closest you'll
  49. come to a pure assembler program, but without having to code in
  50. assembly language.  And if you do use assembly language, P.D.Q.
  51. will help you with floating point math, TSR programs, dynamic
  52. strings, file and device input and output, sound, and multi-
  53. dimensional arrays.
  54.  
  55. The primary purpose of P.D.Q. is to write small to medium-sized
  56. applications, where program size and execution speed are
  57. critical.  Because P.D.Q. programs are inherently well-behaved,
  58. they may also be run under operating systems such as
  59. Quarterdeck's DESQview and Microsoft Windows without requiring
  60. additional programming effort.  A wealth of string, DOS, and
  61. BIOS services are provided, along with full support for modern
  62. programming constructs and user-defined variables.
  63.  
  64. Best of all, TSR programming support and interrupt handling are
  65. built into the P.D.Q. library.  You can create complete memory-
  66. resident applications in just minutes, instead of days or even
  67. weeks.  TSR capabilities are added using four simple subroutine
  68. calls, and the P.D.Q. routines then handle all the details of
  69. memory allocation, the DOS "busy" flag, deinstallation, and so
  70. forth.  A P.D.Q. TSR program can even intercept multiple
  71. interrupts, with separate program entry points for each.
  72.  
  73. The TSR capabilities are especially impressive, and very easy
  74. to use.  You simply specify which hot key to use, and where in
  75. the program control is to go when that key is pressed.  Real
  76. interrupt handlers are just as easy to create-- you indicate
  77. the interrupt to take over and where in the program the handler
  78. is located.  Once the interrupt handler is in place you can
  79. process it entirely yourself and return to the underlying
  80. program, call the original handler as a subroutine, or jump to
  81. the original handler.  Your program has full access to the CPU
  82. registers at all times.
  83.  
  84. Without doubt, P.D.Q. is the most revolutionary and exciting
  85. concept in high-level languages to come along in years.  But
  86. what is it?
  87.  
  88.  
  89.  
  90.                        As Easy As BASIC
  91.  
  92.  
  93.  
  94. P.D.Q. is a replacement linking library for use with
  95. Microsoft's QuickBASIC and BASIC PDS compiler.  By completely
  96. rewriting the BASIC language library, we were able to improve
  97. the efficiency of the resultant code enormously.  All of the
  98. "handholding" that BASIC normally adds to every program has
  99. been removed, leaving only the essential elements.  Thus, you
  100. can be productive immediately, without having to struggle with
  101. yet another new language.
  102.  
  103. We also overhauled BASIC's convoluted method of handling DOS
  104. errors.  Where conventional BASIC requires you to first define
  105. an error handler and then set up an ON ERROR trap to jump
  106. there, P.D.Q. lets you simply test the success or failure of
  107. the most recent DOS operation.  The short program fragment
  108. below shows this in context.
  109.  
  110.    OPEN "accounts.dat" FOR INPUT AS #1
  111.    IF ERR = 53 THEN PRINT "Sorry, file not found."
  112.  
  113.  
  114.  
  115.                           Why BASIC?
  116.  
  117.  
  118.  
  119. Some programmers, particularly those who don't ordinarily
  120. program in BASIC, may wonder why we selected Microsoft BASIC as
  121. the core language for P.D.Q.  Simply put, BASIC is the easiest
  122. of all high-level languages to use, and nearly every programmer
  123. is already familiar with it.  Microsoft compiled BASIC provides
  124. all of the features needed for modern, structured programming.
  125.  
  126. By using BASIC, P.D.Q. is able to offer an impressive list of
  127. string handling features, along with sound, direct memory and
  128. port access, automatic variable type conversion, and structured
  129. data.  Of course, BASIC also supports dynamic memory
  130. allocation, variable length strings, access to DOS and BIOS
  131. services, and protection against inadvertently overwriting
  132. memory.  Further, P.D.Q. is fully compatible with subroutines
  133. and functions written in assembly language such as those in our
  134. QuickPak Professional.
  135.  
  136. Finally, the BC.EXE compiler supplied with Microsoft BASIC is
  137. as powerful and capable as any language compiler.  Programs may
  138. be written and debugged in the convenient environment BASIC
  139. offers, and then linked for maximum performance when creating
  140. the final program.
  141.  
  142.  
  143.  
  144.                    The Spirit of Performance
  145.  
  146.  
  147.  
  148. Our goal in designing P.D.Q. was to place code size and
  149. execution speed above all other considerations.  Many
  150. programmers incorrectly believe that compiled languages are
  151. inherently large and slow, simply because they are compiled.
  152. But nothing could be further from the truth.  In many cases,
  153. the Microsoft BASIC compiler generates object code as efficient
  154. as a human hand-coding in assembly language.  The real problem
  155. with most compilers is the way their language libraries have
  156. been implemented.  By taking an entirely new and different
  157. approach to language design, P.D.Q. is able to create programs
  158. that are nearly as small and fast as those written in assembly
  159. language.
  160.  
  161. Like most compilers, Microsoft BASIC translates simple program
  162. statements directly to the equivalent machine-code
  163. instructions.  For example, X% = X% + 1 is compiled to INC WORD
  164. PTR [X%].  However, more complex commands generate calls to the
  165. BASIC language library.  And that's where P.D.Q. comes in.  All
  166. of the routines in the P.D.Q. library are extremely efficient,
  167. and have been optimized to the fewest number of bytes and
  168. machine clock cycles.
  169.  
  170.  
  171.  
  172.                  But Isn't That What C Is For?
  173.  
  174.  
  175.  
  176. One of the promises of C was to provide smaller and faster
  177. programs, in exchange for additional programming effort.  If
  178. you were willing to step down to a lower level language nearer
  179. to assembler, the compiler would reciprocate by generating a
  180. more efficient program.  But this simply isn't true-- the
  181. current generation of C compilers offers little if any
  182. improvement over QuickBASIC 4.5.  In fact, compared to P.D.Q.,
  183. C is just another slow and bloated high-level language!  By
  184. contrast, P.D.Q. is nearly as easy to use as conventional
  185. BASIC, while providing a level of performance that is clearly
  186. superior to C.  And everyone knows that performance is what
  187. programming is all about.
  188.  
  189.  
  190.  
  191.                         How We Did It?
  192.  
  193.  
  194.  
  195. In order to achieve such impressive file sizes and high
  196. performance, we did have to make some compromises.  BASIC's
  197. graphics, communications, and advanced (transcendental) math
  198. operations are not supported; however, Crescent also sells
  199. graphics and communications libraries for programs that need
  200. those capabilities.  Further, statements that access DOS and
  201. BIOS services provide little or no error checking.  For
  202. example, if you attempt to position the cursor at an illegal
  203. row or column, P.D.Q. simply passes your parameters on to the
  204. BIOS which ignores them.
  205.  
  206.  
  207.  
  208.                       Seeing is Believing
  209.  
  210.  
  211.  
  212. Compare the sample programs created using P.D.Q. with
  213. equivalent programs written in QuickC, Turbo C, Turbo Pascal,
  214. and regular QuickBASIC 4.5.  The benchmark timings shown below
  215. were obtained using a Northgate Elegance 386-25 computer, but
  216. slowed down to 8 MHz to obtain repeatable results.  A RAM disk
  217. was used for the read/write timings.  All .EXE file sizes are
  218. in bytes, and all times are given in seconds.
  219.  
  220. The Num-Off utility turns the NumLock key off and the Hello
  221. program simply prints "hello"-- these show the effective
  222. minimum program size for each language system.  Note that the
  223. P.D.Q. Hello program includes the entire dynamic string
  224. management portion of the runtime library!  The DOS filter
  225. program accepts input from STDIN, capitalizes it and strips the
  226. high bit from each character, and sends the result through
  227. STDOUT.
  228.  
  229. The Epson set-up program is a small, menu-driven utility that
  230. sends escape codes for various printer characteristics.  The
  231. TSR version can be popped up on top of any text-mode program,
  232. and it saves and restores the underlying screen.  Finally, the
  233. File Size program is a clone of Peter Norton's 9K FS.COM
  234. utility.  It reads all files whose names match a given spec,
  235. adds up their sizes, and also checks if they will fit onto a
  236. selected target.  Like Norton's, our version also takes the
  237. target cluster size into account when determining if the files
  238. will fit.
  239.  
  240. For the long integer multiply test, 150 multiplications were
  241. performed in a loop 1,000 times.  Please note that the Turbo C
  242. programs were compiled using the Small memory model which
  243. produces .COM files.  Also note that we have optimized long
  244. integer operations for size rather than speed.  Finally, a bug
  245. in the sort routine provided with QuickC is responsible for its
  246. poor showing in that category.
  247.  
  248.  
  249.  
  250.                      File Size Comparisons
  251.  
  252.  
  253.                        P.D.Q.  QC 2.0  TC 2.0  TP 5.5  QB 4.5
  254.  +-------------------+-------+-------+-------+-------+-------+
  255.  | Num-Off Utility   |   418 |  2371 |   990 |  2845 | 10325 |
  256.  | Print Hello       |   754 |  5363 |  3958 |  3260 | 12798 |
  257.  | DOS filter        |  1482 |  5345 |  4970 |  3443 | 19523 |
  258.  | Epson Set-up      |  2228 |  7837 |  8030 |  8014 | 35877 |
  259.  | TSR Epson Set-up  |  4800 |   n/a |   n/a |   n/a |   n/a |
  260.  | File-Size program |  4956 | 10537 |  7814 |  8809 | 19650 |
  261.  +-------------------+-------+-------+-------+-------+-------+
  262.  
  263.  
  264.  
  265.                       Timing Comparisons
  266.  
  267.  
  268.                         P.D.Q.  QC 2.0  TC 2.0  TP 5.5  QB 4.5
  269. +---------------------+-------+-------+-------+-------+-------+
  270. | Long Int Multiply   |  2.64 |  2.31 |  2.25 |  7.52 |  3.02 |
  271. | Long Int Mult (386) |  2.20 |  2.31 |  2.25 |  7.52 |  3.02 |
  272. | Sort 3000 Strings   |  0.60 |144.89 |  1.54 |  0.99 |  1.92 |
  273. | Print 3000 Strings  |  0.88 |  1.15 |  1.04 |  3.52 |  2.04 |
  274. | Write 500 Records   |  0.33 |  0.33 |  0.66 |  0.44 |  0.38 |
  275. | Read 500 Records    |  0.27 |  0.27 |  0.27 |  0.49 |  0.28 |
  276. +---------------------+-------+-------+-------+-------+-------+
  277.  
  278.  
  279.  
  280.  
  281.                         What's Included
  282.  
  283.  
  284.  
  285. P.D.Q. is supplied as two library files-- PDQ.LIB is intended
  286. for use with any IBM PC/XT/AT or compatible computer, and
  287. PDQ386.LIB is a 386-specific version for use with computers so
  288. equipped.  In all, more than 190 BASIC statements and keywords
  289. are supported.
  290.  
  291. More than 90 useful language extensions are provided including
  292. memory allocation, DOS critical error trapping, block memory
  293. moves and comparisons, string array sorting, a complete set of
  294. TSR extensions including swapping to disk or EMS, output
  295. through STDERR, access to the parent's environment, and much
  296. more.  Many programming examples and utilities are also
  297. included, as well as a comprehensive owner's manual.
  298.  
  299. Finally, P.D.Q. comes with complete, commented library source
  300. code so you can see exactly how it works, or even modify and
  301. extend the language if you like.
  302.  
  303.  
  304.  
  305.                    What's New in Version 3.0
  306.  
  307.  
  308.  
  309. Many new and important features have been added in version 3.0.
  310. These include: Floating point math that automatically uses a
  311. coprocessor if present; full network file support; TSR programs
  312. that swap to disk or EMS to take as little memory as possible;
  313. bit manipulation; and safe DOS and BIOS access within TSR
  314. programs that handle interrupts manually.  The manual has been
  315. greatly expanded, and now totals more than 500 pages.  Numerous
  316. new example and utility programs have been added, including a
  317. menu-driven environment for compiling and linking, TSR programs
  318. that capture printer output and keystrokes to disk, color
  319. printing with no source code changes, and much more.
  320.  
  321. Equally exciting is the new assembly language toolbox
  322. capability.  The entire P.D.Q. library internal operation is
  323. now fully documented, and there are many examples showing how
  324. to add BASIC-like capabilities to programs written in assembly
  325. language.  Every routine is described in detail, accompanied by
  326. a description, calling convention, and brief example.  Many
  327. complete assembler programs are provided as examples showing
  328. how to utilize dynamic strings, IEEE floating point math, and
  329. all of the P.D.Q. TSR capabilities.
  330.  
  331.  
  332.  
  333.                      System Requirements
  334.  
  335.  
  336.  
  337. P.D.Q. requires QuickBASIC 4.0 or later or BASIC 7 PDS; DOS 2.1
  338. or later; 256K RAM; and a PC/XT/AT or compatible computer.
  339. 5-1/4 inch disks are standard, although 3-1/2 inch disks are
  340. available if specified when ordering.
  341.  
  342.  
  343.  
  344.                    About Crescent Software
  345.  
  346.  
  347.  
  348. Crescent Software publishes many other useful products for
  349. BASIC programmers.  We offer general purpose toolboxes, as well
  350. as programs for graphics, screen design, communications, laser
  351. printing, scientific applications, and more.  All products
  352. include complete source code, free technical support, and
  353. royalties are never required.
  354.  
  355.  
  356.  
  357.                The Best Reviews in the Business
  358.  
  359.  
  360.  
  361. P.D.Q. won Byte Magazine's User's Choice Award for Language of
  362. the Year in 1989, and following is additional praise it has
  363. received.
  364.  
  365. "The talk of the programming community...is P.D.Q.  Hot stuff,
  366. for sure."-- John Dvorak, PC Magazine, November 28, 1989
  367.  
  368. "Every QuickBASIC programmer ought to have P.D.Q.-- the speed
  369. and code size reduction will amaze you.  Recommended."-- Jerry
  370. Pournelle, Byte Magazine, February 1990
  371.  
  372. "I feel sure the approach taken by Crescent Software is the
  373. approach the whole industry will follow in the future."-- Bruce
  374. Tonkin, Dr. Dobb's Journal, December 1989
  375.  
  376. "The combination of TSR ability and small code makes P.D.Q. a
  377. contender for a development environment of choice."-- Jeff
  378. Angus, Computer Language, December 1989
  379.  
  380. "I think P.D.Q. will very likely become one of the best-selling
  381. add-ons of all time."-- Jim Pyle, PCM Magazine, February 1990
  382.  
  383. "You can write TSR code without having to worry about the
  384. technicalities...I like P.D.Q."-- Hardin Brothers, PC Resource,
  385. March 1990
  386.